package route

import (
	"fmt"

	"helloworld/internal/middleware"

	"github.com/go-kratos/kratos/v2/transport/http"
)

func UpServer(hs *http.Server) {
	registerPprof(hs)
	hs.HandlePrefix("/", GinRouter())

	hs.Use("/*", middleware.Jwt())

	//==========
	router := hs.Route("/")

	NewFileServer().InitRoute(router)

	router.Group("/", middleware.RouteFilter, middleware.RouteFilterx)
	//type FilterFunc func(http.Handler) http.Handler
	hs.WalkRoute(func(info http.RouteInfo) error {
		fmt.Println("WalkRoute:", info.Method, info.Path)
		return nil
	})
}

//hs.HandlePrefix("/", GinRouter())
